﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TechnicRequests>" %>
<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TechnicRequests>" %>--%>
<%@ Import Namespace="CRM.Resourses" %>

<% Html.DevExpress().GridView(settings =>
                    {
                        settings.Name = "gdTechnicRequestsAttachments";
                        settings.KeyFieldName = "IdTechnicRequestsAttachment";
                        settings.CallbackRouteValues = new { Controller = "TD", Action = "TechnicRequestsAttachmentsPartial", idRequest = Model.IdTechnicRequest };
                        settings.SettingsPager.PageSize = 20;
                        settings.Width = 243;

                        //settings.Columns.Add(column =>
                        //{
                        //    column.Caption = Resourses.TechnicFileName;
                        //    column.FieldName = "Name";
                        //});

                        settings.Columns.Add(column =>
                        {
                            column.Caption = Resourses.TechnicFileName;
                            column.FieldName = "Path";
                            column.ColumnType = MVCxGridViewColumnType.HyperLink;
                            column.Settings.AutoFilterCondition = AutoFilterCondition.Contains;
                            HyperLinkProperties properties = column.PropertiesEdit as HyperLinkProperties;
                            //String urlFormatString = Url.Action("TechnicRequestDetails", "TD", new RouteValueDictionary(new { idTecnicRequest = "{0}" }));
                            String urlFormatString = "{0}";
                            properties.NavigateUrlFormatString = HttpUtility.UrlDecode(urlFormatString);
                            properties.TextField = "Name";
                        });
                        
                    }).Bind(Model.TechnicRequestAttachments).GetHtml();%>